package org.s.com.springioc.component;

import org.s.com.springioc.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component//组件使用的注解(将bean存储到ioc中)
public class UserComponent {
    public void say(){
        System.out.println("hi,UserComponent");
    }
    @Primary
    @Bean
    public User u2(){
        return new User();
    }
    @Bean
    public User u1(){
        return new User();
    }
    @Bean
    public User u3(){
        return new User();
    }
}
